<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>

<s:layout-render name="/frontend/layout.jsp" title="frontend.roomsList.title">
    <s:layout-component name="body">
        <s:useActionBean beanclass="cz.muni.fi.pa165.bookingmanager.web.FrontEndActionBean" var="actionBean"/>
        <div class="content_right_section">        	
            <div class="content_title_01"><f:message key="frontend.roomsList.title" /></div>  
            
            <h2><f:message key="frontend.global.arrival" />: <c:out value="${param.startDate}" /></h2>
            <h2><f:message key="entities.reservation.duration" />: <c:out value="${param.duration}" /></h2>
            
            <table width="100%">
                <tr>
                    <th><f:message key="entities.room.room_Number" /></th>
                    <th><f:message key="entities.room.capacity" /></th>
                    <th><f:message key="entities.room.price" /></th>
                    <th><f:message key="entities.reservation.total_price" /></th>
                    <th></th>
                </tr>
            <c:forEach var="room" items="${actionBean.getListRooms()}" >
                <tr>
                    <th>${room.roomNumber}</th>
                    <th>${room.capacity}</th>
                    <th>${room.price}</th>
                    <th>${room.price * param.duration}</th>
                    <th>
                        <div class="rc_btn_02">
                            <s:link beanclass="cz.muni.fi.pa165.bookingmanager.web.FrontEndActionBean" event="bookRoom">
                                <s:param name="room.id" value="${room.id}" />
                                <s:param name="hotel.id" value="${room.hotel.id}" />
                                <s:param name="startDate" value="${param.startDate}" />
                                <s:param name="startDateRaw" value="${param.startDateRaw}" />
                                <s:param name="duration" value="${param.duration}" />                                
                                <f:message key="frontend.roomsList.book" />
                            </s:link>
                        </div>
                    </th>
                </tr>
            </c:forEach> 
            </table>
       	</div>
        <div class="cleaner_h40">&nbsp;</div>
        
        
    </s:layout-component>
</s:layout-render>

